package cn.hairui.blog.service.impl;

import cn.hairui.blog.model.Tool;
import cn.hairui.blog.repository.ToolRepository;
import cn.hairui.blog.service.ToolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author lihairui
 * @version V1.0
 * @date: 2019/7/28 22:26
 */
@Service(value = "toolService")
public class ToolServiceImpl implements ToolService {

    @Autowired
    private ToolRepository toolRepository;

    @Override
    public List<Tool> findLimited(int count) {
        return toolRepository.findLimited(count);
    }

    @Override
    public Tool find(int id) {
        return toolRepository.find(id);
    }

    @Override
    public List<Map> listMgr() {
        return toolRepository.listMgr();
    }

    @Override
    public int add(Tool tool) {
        return toolRepository.add(tool);
    }

    @Override
    public void update(Tool tool) {
        toolRepository.update(tool);
    }

    @Override
    public void delete(int id) {
        toolRepository.delete(id);
    }

    @Override
    public List<Tool> list() {
        return toolRepository.list();
    }
}
